package com.icewld.meiflowerway;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

import javax.crypto.Mac;

public class InputViewer extends AppCompatActivity {

    EditText[] inputbox = new EditText[2];
    Button   sure_click;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_input_viewer);

        inputbox[0] = (EditText)findViewById(R.id.editText);
        inputbox[1] = (EditText)findViewById(R.id.editText2);
        sure_click  = (Button)findViewById(R.id.button2);

        sure_click.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(InputViewer.this, ResultViewer.class);
                MainCalModel mcm = new MainCalModel(Integer.parseInt(inputbox[0].getText().toString()),
                        Integer.parseInt(inputbox[1].getText().toString()));
                intent.putExtra("Cal", mcm);
                startActivity(intent);
            }
        });
    }
}
